package com.wufeng.model.SpringBootModel.other;

public class FinallyDemo {
    static int num = 0;
    static int inc(){
        System.out.println("static inc");
        return ++ num;
    }
    static int dec(){
        System.out.println("static dec");
        return -- num;
    }

    static int get(){
        try{
            System.out.println("static get");
            return 1;
        }finally {
            System.out.println("finally");
//            num = 10;
            return 2;
        }
    }

    public static void main(String[] args) {
//        System.out.println(get());
//        inc();
//        System.out.println(num);
        System.out.println(get());
//        dec();
        System.out.println(num);

    }
}
